package com.linkeleee.web.controller.user;

import com.linkeleee.core.response.APIResponse;
import com.linkeleee.user.api.LoginRpcService;
import com.linkeleee.user.response.LoginResp;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * 登陆controller
 * @author liyaoyang
 */
@RestController
public class LoginController {

    @DubboReference
    private LoginRpcService loginRpcService;

    /**
     * 登陆请求
     * @param userName 用户名
     * @param userPassword 密码
     * @return
     */
    @GetMapping("/user/login/{userName}/{userPassword}")
    public APIResponse<LoginResp> login(@PathVariable("userName") String userName,
                                        @PathVariable("userPassword") String userPassword){
        return loginRpcService.login(userName,userPassword);
    }



}
